Tools for translating USA NTSC version of Parasite Eve 1
(SLUS-00662, SLUS-00668)

Usage:

1. copy PE.IMG and SLUS_006.62 from PE1 CD1 to "orgImg" folder
   (note: CD1 and CD2 have same PE.IMG and SLUS_006.62)
2. use "extractFromImg" to extract all data to "extracted" folder
3. copy data from "extracted" folder to "import" folder, modify them
   (Extract folder can be overwritten by bats, import should not, make backups!)
4. use "importToImg" to import modified data from "import" folder
5. import files from "imgNew" folder to PE1 CD1 and CD2
6. reextract new created files in "imgNew" and compare "extracted" and "import" folder
   (do steps 1 and 2 for new created PE.IMG and SLUS files)
   (optional, reextract validation of correctly imported data)


Extract/import PE.IMG
 - use cdmage to extract and import PE.IMG and SLUS, select "M2/2352" mode on first opening

Custom fonts/table
 - edit "workdir\!pes.tbs" file (character conversion file)
 - edit before extraction (step 1.)
 - edit fonts

Italian font hack
   (ripped from Italian translation, used without asking. Thanks to great men from SadNES cITy.)
 - Italian font hack double space for fonts, so it is possible add more characters
 - use/edit "import\fonts\fontWidth_FH.bin" file (rename to fontWidth.bin), if using italian font hack

Turn off italian font hack
 - rename file workdir\importSlusFH.bat to workdir\importSlusFH.off

Special extracted files
 - extracted\dothers\slus.txt
   - don't change file size
   - only overwrite texts
 - extracted\fonts
   - see font format part
 - extracted\tims\misc_16b.tim
 - extracted\tims\misc_4b.tim
   - same files, but once as complete 16 bit tim, once as 4bit part
   - raw image used for VRAM, contain 4bit, 8bit and 16bit graphic
   - unknown original palette (supposed to be too part of this image)
   - 4 bit contain unique color palette, edit palette to get easier editing
   - edit/import only one from them (16b or 4b)
   - if importing 4b file, only pixel are copied (not palette)
   - if importing 16b file, whole image data are copied
     (not copy TIM header - first 8 bytes)


Backgrounds:
 - files with backgrounds to be extracted/imported are in workdir\etemp2dbText.txt
   (background export/import is tested only on these files, some others maybe not work)
 - support only for modifying existing tiles (no adding new tiles)
 - imported backgrounds are reextracted to extracted\backgroundRe to visual check if import correct
   (import can be bad, need visual check)
   (reextract can be turned off with renaming workdir\extractBackgroundRe.bat to extractBackgroundRe.off)
 - 2_1B5* files rename to 2_1B5_000_0200_di.bmp and 2_1B5_001_0201_di.bmp to be able import
   (import with duplicity import flag '_di', which imports tile even if there are some duplicity issues)
   (this is due 2_1B5 weird duplicity and import tool limitations)


Movies
 - see importMovie\!readme.txt


------------------------------------------------------------------------------------------------------------

Fonts:
fonts.tim
 - TIM file 
 - font size 12*10px

fontWidth.bin
 - displayed fonts widths
 - width of whole character(font) including spacing
POS SIZE
0   1B  always zero?
1   1B  font width (FW)

 - for Italian font hack (twice space for fonts)
0   1B  font width (FW)

fontAlign.bin
 - font align
 - how is character(font) aligned on screen, how looks in font TIM file
0b  4b  space before font in px (low nibble, Value&4) (FS)
4b  4b  font width in px (width of part with pixel) (FP)

Usually
 - FW = FS + FP + 1; (1 for space behind character)

maybe possible use some japanese fonts
(some are displayed, probably those starting with opcodes or high number)
